Update graphqlcodegenerator monorepo to v3 (major) #294
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.16.5->3.3.02.6.1->3.0.1^2.8.7->^3.0.0^2.13.7->^3.0.0Release Notes
dotansimha/graphql-code-generator (@graphql-codegen/cli)
v3.3.0Compare Source
Minor Changes
#9151
b7dacb21fThanks @'./user/schema.mappers#UserMapper',! - AddwatchPatternconfig option forgeneratessections.By default,
watchmode automatically watches all GraphQL schema and document files. This means when a change is detected, Codegen CLI is run.A user may want to run Codegen CLI when non-schema and non-document files are changed. Each
generatessection now has awatchPatternoption to allow more file patterns to be added to the list of patterns to watch.In the example below, mappers are exported from
schema.mappers.tsfiles. We want to re-run Codegen if the content of*.mappers.tsfiles change because they change the generated types file. To solve this, we can add mapper file patterns to watch using the glob pattern used for schema and document files.Then, run Codegen CLI in
watchmode:Now, updating
*.mappers.tsfiles re-runs Codegen! 🎉Note:
watchPatternis only used inwatchmode i.e. running CLI with--watchflag.Patch Changes
b7dacb21f,f104619ac]:v3.2.2Compare Source
Patch Changes
#9086
a34cef35bThanks @beerose! - dependencies updates:graphql-config@^4.5.0↗︎ (from^4.4.0, independencies)jiti@^1.17.1↗︎ (todependencies)cosmiconfig-typescript-loader@^4.3.0↗︎ (fromdependencies)ts-node@^10.9.1↗︎ (fromdependencies)#9086
a34cef35bThanks @beerose! - Supportcodegen.tsin ESM projectsv3.2.1Compare Source
Patch Changes
#9051
f7313f7caThanks @saihaj! - dependencies updates:micromatch@^4.0.5↗︎ (todependencies)#9051
f7313f7caThanks @saihaj! - only run generate for files that users have listed in config to avoid running this over every change that codegen is not supposed to executev3.2.0Compare Source
Minor Changes
288ed0977Thanks @saihaj! - use @parcel/watcher for improved watch functionalityPatch Changes
288ed0977Thanks @saihaj! - dependencies updates:@parcel/watcher@^2.1.0↗︎ (todependencies)chokidar@^3.5.2↗︎ (fromdependencies)v3.1.0Compare Source
Minor Changes
#8893
a118c307aThanks @n1ru4l! - It is no longer mandatory to declare an empty plugins array when using a preset#8723
a3309e63eThanks @kazekyo! - Introduce a new feature called DocumentTransform.DocumentTransform is a functionality that allows you to modify
documentsbefore they are processed by plugins. You can use functions passed to thedocumentTransformsoption to make changes to GraphQL documents.To use this feature, you can write
documentTransformsas follows:For instance, to remove a
@localOnlyDirectivedirective fromdocuments, you can write the following code:DocumentTransform can also be specified by file name. You can create a custom file for a specific transformation and pass it to
documentTransforms.Let's create the document transform as a file:
Then, you can specify the file name as follows:
Patch Changes
4c422ccf6Thanks @renovate! - dependencies updates:@whatwg-node/fetch@^0.8.0↗︎ (from^0.6.0, independencies)8206b268d,8206b268d,a118c307a,a3309e63e]:v3.0.0Compare Source
Major Changes
fd0b0c813Thanks @n1ru4l! - drop Node.js 12 supportPatch Changes
#8883
321d5112eThanks @Solo-steven! - Fix PluckConfig overwrite problem.Updated dependencies [
fc79b65d4,fd0b0c813]:dotansimha/graphql-code-generator (@graphql-codegen/schema-ast)
v3.0.1Compare Source
Patch Changes
8206b268dThanks @renovate! - dependencies updates:tslib@~2.5.0↗︎ (from~2.4.0, independencies)8206b268d,a118c307a,a3309e63e]:v3.0.0Compare Source
Major Changes
fd0b0c813Thanks @n1ru4l! - drop Node.js 12 supportPatch Changes
fc79b65d4,fd0b0c813]:dotansimha/graphql-code-generator (@graphql-codegen/typescript)
v3.0.3Compare Source
Patch Changes
#9150
92d86b009Thanks @rliljest! - Properly escape enum identifiers when enumsAsConst is usedUpdated dependencies [
e56790104,b7dacb21f,f104619ac,acb647e4e,9f4d9c5a4]:v3.0.2Compare Source
Patch Changes
ba0610bbd,4b49f6fbe,b343626c9]:v3.0.1Compare Source
Patch Changes
8206b268dThanks @renovate! - dependencies updates:tslib@~2.5.0↗︎ (from~2.4.0, independencies)8206b268d,8206b268d,8206b268d,a118c307a,6b6fe3cbc,a3309e63e]:v3.0.0Compare Source
Major Changes
fd0b0c813Thanks @n1ru4l! - drop Node.js 12 supportPatch Changes
fc79b65d4,fd0b0c813]:dotansimha/graphql-code-generator (@graphql-codegen/visitor-plugin-common)
v3.1.0Compare Source
Minor Changes
#9146
9f4d9c5a4Thanks @eddeee888! - [typescript-resolvers] AddresolversNonOptionalTypenameconfig option.This is extending on
ResolversUnionTypesimplemented in https://github.com/dotansimha/graphql-code-generator/pull/9069resolversNonOptionalTypenameadds non-optional__typenameto union members ofResolversUnionTypes, without affecting the union members' base intefaces.A common use case for non-optional
__typenameof union members is using it as the common field to work out the final schema type. This makes implementing the union's__resolveTypevery simple as we can use__typenameto decide which union member the resolved object is. Without this, we have to check the existence of field/s on the incoming object which could be verbose.For example, consider this schema:
With optional
__typename: We need to check existence of certain fields to resolve type in the union resolver:With non-optional
__typename: Resolvers declare the type. This which gives us better TypeScript support in resolvers and simplify__resolveTypeimplementation:Using
resolversNonOptionalTypename: add it intotypescript-resolversplugin config:Patch Changes
#9206
e56790104Thanks @eddeee888! - FixResolversUnionTypesbeing used inResolversParentTypesPreviously, objects with mappable fields are converted to Omit format that references its own type group or
ResolversTypesorResolversParentTypese.g.In https://github.com/dotansimha/graphql-code-generator/pull/9069, we extracted resolver union types to its own group:
This change creates an extra
ResolversUnionParentTypesthat is referenced byResolversParentTypesto ensure backwards compatibility:#9194
acb647e4eThanks @dstaley! - Don't emit import statements for unused fragmentsUpdated dependencies [
b7dacb21f,f104619ac]:v3.0.2Compare Source
Patch Changes
#9110
ba0610bbdThanks @gilgardosh! - Custom mappers with placeholder will apply omit#9069
4b49f6fbeThanks @eddeee888! - Extract union types to ResolversUnionTypes#8895
b343626c9Thanks @benkroeger! - Preserve .js extension when importDocumentNodeExternallyFrom and emitLegacyCommonJSImports is falsev3.0.1Compare Source
Patch Changes
#8879
8206b268dThanks @renovate! - dependencies updates:tslib@~2.5.0↗︎ (from~2.4.0, independencies)#8971
6b6fe3cbcThanks @n1ru4l! - Always inline referenced fragments within their document. This prevents issues with duplicated fragments or missing fragments.Updated dependencies [
8206b268d,a118c307a,a3309e63e]:v3.0.0Compare Source
Major Changes
fd0b0c813Thanks @n1ru4l! - drop Node.js 12 supportPatch Changes
#8871
fc79b65d4Thanks @B2o5T! - eslint fixesUpdated dependencies [
fc79b65d4,fd0b0c813]:Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.